#include "pointf.h"

namespace zgq
{
	bool PointF::operator!=(const PointF& data)
	{
		return !(*this == data);
	}

	PointF::PointF() :m_X(0), m_Y(0) {
	}



	PointF::PointF(const PointF& data)
	{
		m_X = data.m_X;
		m_Y = data.m_Y;
	}

	PointF::PointF(double x, double y)
	{
		m_X = x;
		m_Y = y;
	}

	PointF PointF::operator+(const PointF& data)
	{
		return PointF(m_X + data.m_X, m_Y + data.m_Y);
	}

	PointF PointF::operator-(const PointF& data)
	{
		return PointF(m_X - data.m_X, m_Y - data.m_Y);
	}

	bool PointF::operator==(const PointF& data)
	{
		return (m_X == data.m_X) && (m_Y == data.m_Y);
	}

	void PointF::operator=(const PointF& data)
	{
		m_X = data.m_X;
		m_Y = data.m_Y;
	}

	void PointF::setX(int x)
	{
		m_X = x;
	}

	void PointF::setY(int y)
	{
		m_Y = y;
	}

	double PointF::x() const
	{
		return m_X;
	}
	double PointF::y() const
	{
		return m_Y;
	};

	std::ostream& operator<<(std::ostream& os, const PointF& data)
	{
		os << "zgq::PointF(" << data.m_X << "," << data.m_Y << ")";
		return os;
	}
}

